from redis import StrictRedis


class Config:
    DEBUG = None

    SECRET_KEY = "FyIR9q8XTI7RjoZhlWT+B9CUeewTLedXNEApDrn3KgZSXrrIW3vRgA=="

    SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@localhost/flask_news"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = 6379

    SESSION_TYPE = "redis"
    SESSION_USE_SIGNER = True
    PERMANENT_SESSION_LIFETIME = 86400

    redis_id = StrictRedis(host=REDIS_HOST, port=REDIS_HOST)


class Development(Config):
    DEBUG = True


class Production(Config):
    DEBUG = False


config = {
    "development": Development,
    "production": Production
}
